/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2024-05-21
 * Time: 22:56
 */
public class Deom6 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            while(true) {
                System.out.println("打印线程1");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        },"线程1");

        t1.start();

        while(true) {
            System.out.println("打印main");
            Thread.sleep(1000);
        }
    }
}
